using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter08
{
	/// <summary>
	/// Example08: Let's Go Skiing
	/// A skier starts from rest at the top of a frictionless 
	/// incline of height 20.0 m, as shown in Figure 8.13. 
	/// At the bottom of the incline, she encounters a horizontal 
	/// surface where the coefficient of kinetic friction between 
	/// the skis and the snow is 0.210. How far does she travel 
	/// on the horizontal surface before coming to rest, 
	/// if she simply coasts to a stop?
	/// d = 95.2 m
	/// </summary>
	public class Example08
	{
		public Example08()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Mass m = new L.Mass();
			m.kg = 1.0;
			L.Length h = new L.Length();
			h.m = 20.0;
			L.PotentialEnergy U = new L.PotentialEnergy();
			U.J = m.kg*L.Constant.AccelerationOfGravity*h.m;
			L.Work W = new L.Work();
			W.J = U.J;
			L.KineticEnergy Ki = new L.KineticEnergy();
			Ki.J = 0.0;
			L.KineticEnergy Kf = new L.KineticEnergy();
			Kf.VariableQ = true;
			L.FundamentalLaw.WorkEnergyTheorem(Ki,W,Kf);
			L.Velocity vf = new L.Velocity(m,Kf);
			double d = Kf.J/m.kg/L.Constant.AccelerationOfGravity/0.21;
			result += Convert.ToString(d);
		}
	}
}
